package com.example.robertluozizhao.framecollectdemo.activity;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;

import com.example.robertluozizhao.framecollectdemo.R;
import com.example.robertluozizhao.framecollectdemo.view.SlideMenuViewGroup;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by robert.luozizhao on 2018/1/11.
 */

public class CustomSlideMenuActivity extends AppCompatActivity {


    @BindView(R.id.sv_view)
    SlideMenuViewGroup mSvView;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_slidemenu);
        ButterKnife.bind(this);

        mSvView.getImageButton().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mSvView.getSlideMenuState()) {
                    mSvView.setSlideMenuHidden();
                }else {
                    mSvView.setSlideMenuShow();
                }
            }
        });

    /*    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        mImageView = new ImageView(this);
        mImageView.setLayoutParams(params);
        mImageView.setImageResource(R.drawable.icon_ball);
        mSvView.addView(mImageView);
        mImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mSvView.getSlideMenuState()) {
                    mSvView.setSlideMenuHidden();
                }else {
                    mSvView.setSlideMenuShow();
                }
            }
        });*/
    }

}
